import React, {Component, Fragment} from "react";
import {TaskEntity} from "./TaskEntity";

export default class TaskAdd extends Component {
    constructor(props) {
        super(props);
    }

    onAdd() {
        this.props.onAdd(new TaskEntity(this.refs.input.value, false, false));
    }

    render() {
        return (
            <Fragment>
            <input type="text" ref='input' placeholder="输入任务..."/>
            &nbsp;
    <button onClick={this.onAdd.bind(this)}>增加</button>
        </Fragment>
    );
    }
}